//
//  SearchBar.m
//  KnowEveryThings
//
//  Created by lanou3g on 16/5/5.
//  Copyright © 2016年 王玲. All rights reserved.
//

#import "SearchBar.h"
#include "UIImage+image.h"

@implementation SearchBar

- (instancetype )initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.placeholder = @"请输入关键词";
        self.background = [UIImage imageWithOriginaName:@"search.png"];
        //这样出来图片的尺寸和图片的尺寸一样大
        UIImageView *imageVie = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"find.png"]];
        imageVie.contentMode = UIViewContentModeCenter;
        self.leftView = imageVie;
        //不写这句话就不会显示
        self.leftViewMode = UITextFieldViewModeAlways;
    }
    return self;
}

@end
